import numpy as np
import pandas as pd
import matplotlib.pyplot as plt


bmi_life_data = pd.read_csv('bmi_and_life_expectancy.csv')


x = np.array(bmi_life_data[["BMI"]])
y = np.array(bmi_life_data["Life expectancy"])

def draw_data(x, y):
    for i in range(len(x)):
        plt.scatter(x[i], y[i], color='blue', edgecolor='k')
    plt.xlabel('BMI')
    plt.ylabel('Life expectancy')

def display(m, b, color='g'):
    r = np.arange(min(x), max(x), 0.1)
    plt.plot(r, m*r+b, color)


draw_data(x, y)
plt.show()